package com.ichengzi.audit.human.common.redis.web;

import com.ichengzi.audit.human.common.redis.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.LinkedList;
import java.util.List;

@RestController
public class RedisController {

    @Autowired
    private RedisService redisService;

    @GetMapping("/testRedisSet")
    public String testRedisSet(){
        LinkedList<Integer> nums = new LinkedList<>();
        nums.add(1);
        nums.add(2);
        nums.add(3);
        redisService.setCacheList("testNum",nums);
        return "存储成功";
    }
    @GetMapping("/testRedisGet")
    public List<Integer> testRedisGet(){
        List<Integer> testNum = redisService.getCacheList("testNum");
        return testNum;
    }
    @GetMapping("/testRedisDel")
    public boolean testRedisDel(){
        boolean testNum = redisService.deleteObject("testNum");
        return testNum;
    }
    /*@GetMapping("/testRedisUpdate")
    public List<Integer> testRedisUpdate(){
        redisService.
        return testNum;
    }*/

}
